<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
    <input type="text" id="text"><br>
	<input type="button" value="开始" id="start">
	<input type="button" value="结束" id="stop">
 </body>
  <script>
     var text = document.getElementById("text"); 
     var start = document.getElementById("start");
	 var stop = document.getElementById("stop");
	 var i = 1;
	 var s;
	 start.addEventListener("click",function(){
	     s = setInterval(function show(){
		   text.value = i;
		   i++;
		 },1000)
	 })
	 stop.addEventListener("click",function(){
	    clearInterval(s);
	 })
  </script>
</html>
